<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="项目编号" prop="projectNum">
        <el-input
          v-model="queryParams.projectNum"
          placeholder="请输入项目编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项分类别" prop="projectCate">
        <el-input
          v-model="queryParams.projectCate"
          placeholder="请输入项分类别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['business:projectManage:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['business:projectManage:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['business:projectManage:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['business:projectManage:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="projectManageList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="项目编号" align="center" prop="projectNum" />
      <el-table-column label="项目名称" align="center" prop="projectName" />
      <el-table-column label="项目类别" align="center" prop="projectCate" />
      <el-table-column label="项目负责人" align="center" prop="projectUser" />
      <el-table-column label="项目说明" align="center" prop="instructions" />
      <el-table-column label="申请人" align="center" prop="applyUser" />
      <el-table-column label="立项时间" align="center" prop="lxTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.lxTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>

      <el-table-column label="开始时间" align="center" prop="startTime" />
      <el-table-column label="计划结项时间" align="center" prop="finishTime" />
      <el-table-column label="所属公司" align="center" prop="collegeName" />
      <el-table-column label="项目状态" align="center" prop="projectState" />
      <el-table-column label="结项日期" align="center" prop="endTime" />
      <el-table-column label="创建人" align="center" prop="createUser" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['business:projectManage:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['business:projectManage:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改项目管理对话框 -->
    <!--    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
    <!--      <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
    <!--        <el-form-item label="统计口径" prop="projectScope">-->
    <!--          <el-input v-model="form.projectScope" placeholder="请输入统计口径" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="学校代码" prop="schoolCode">-->
    <!--          <el-input v-model="form.schoolCode" placeholder="请输入学校代码" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="学校名称" prop="schoolName">-->
    <!--          <el-input v-model="form.schoolName" placeholder="请输入学校名称" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="学院代码" prop="collegeCode">-->
    <!--          <el-input v-model="form.collegeCode" placeholder="请输入学院代码" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="学院名称" prop="collegeName">-->
    <!--          <el-input v-model="form.collegeName" placeholder="请输入学院名称" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="部系代码" prop="deptCode">-->
    <!--          <el-input v-model="form.deptCode" placeholder="请输入部系代码" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="部系名称" prop="deptName">-->
    <!--          <el-input v-model="form.deptName" placeholder="请输入部系名称" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="科研机构名称" prop="kyjgName">-->
    <!--          <el-input v-model="form.kyjgName" placeholder="请输入科研机构名称" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目编号" prop="projectNum">-->
    <!--          <el-input v-model="form.projectNum" placeholder="请输入项目编号" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目名称" prop="projectName">-->
    <!--          <el-input v-model="form.projectName" placeholder="请输入项目名称" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目类别" prop="projectCate">-->
    <!--          <el-input v-model="form.projectCate" placeholder="请输入项目类别" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目负责人" prop="projectUser">-->
    <!--          <el-input v-model="form.projectUser" placeholder="请输入项目负责人" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目专家" prop="xmzj">-->
    <!--          <el-input v-model="form.xmzj" placeholder="请输入项目专家" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="学科" prop="xk">-->
    <!--          <el-input v-model="form.xk" placeholder="请输入学科" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目预算" prop="xmys">-->
    <!--          <el-input v-model="form.xmys" placeholder="请输入项目预算" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="申报类型" prop="sblx">-->
    <!--          <el-input v-model="form.sblx" placeholder="请输入申报类型" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="开始时间" prop="startTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.startTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择开始时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="结束时间" prop="endTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.endTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择结束时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目说明" prop="instructions">-->
    <!--          <el-input v-model="form.instructions" placeholder="请输入项目说明" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="申请人" prop="applyUser">-->
    <!--          <el-input v-model="form.applyUser" placeholder="请输入申请人" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="申请部门" prop="applyDept">-->
    <!--          <el-input v-model="form.applyDept" placeholder="请输入申请部门" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="申请时间" prop="applyTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.applyTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择申请时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="审核" prop="audit">-->
    <!--          <el-input v-model="form.audit" placeholder="请输入审核" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="意见" prop="opinion">-->
    <!--          <el-input v-model="form.opinion" placeholder="请输入意见" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="审核时间" prop="auditTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.auditTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择审核时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="驳回时间" prop="rejectTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.rejectTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择驳回时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="立项编号" prop="lxNum">-->
    <!--          <el-input v-model="form.lxNum" placeholder="请输入立项编号" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="立项时间" prop="lxTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.lxTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择立项时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="批文号" prop="pwh">-->
    <!--          <el-input v-model="form.pwh" placeholder="请输入批文号" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="活动编码" prop="hdbm">-->
    <!--          <el-input v-model="form.hdbm" placeholder="请输入活动编码" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="活动名称" prop="hdmc">-->
    <!--          <el-input v-model="form.hdmc" placeholder="请输入活动名称" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="活动情况" prop="hdqk">-->
    <!--          <el-input v-model="form.hdqk" placeholder="请输入活动情况" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="活动报告附件" prop="hdbgfj">-->
    <!--          <el-input v-model="form.hdbgfj" placeholder="请输入活动报告附件" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="活动时间" prop="hdsj">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.hdsj"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择活动时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="中检情况" prop="inspection">-->
    <!--          <el-input v-model="form.inspection" placeholder="请输入中检情况" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="中检报告附件" prop="zjbgfj">-->
    <!--          <el-input v-model="form.zjbgfj" placeholder="请输入中检报告附件" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="中检经费" prop="inspectionMoney">-->
    <!--          <el-input v-model="form.inspectionMoney" placeholder="请输入中检经费" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="中检时间" prop="inspectionTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.inspectionTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择中检时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目状态" prop="projectState">-->
    <!--          <el-input v-model="form.projectState" placeholder="请输入项目状态" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="终结情况" prop="zjqk">-->
    <!--          <el-input v-model="form.zjqk" placeholder="请输入终结情况" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="完成时间" prop="finishTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.finishTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择完成时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果名称" prop="cgmc">-->
    <!--          <el-input v-model="form.cgmc" placeholder="请输入成果名称" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果转化作者" prop="cgzhzz">-->
    <!--          <el-input v-model="form.cgzhzz" placeholder="请输入成果转化作者" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果分类" prop="cgfl">-->
    <!--          <el-input v-model="form.cgfl" placeholder="请输入成果分类" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果级别" prop="cgjb">-->
    <!--          <el-input v-model="form.cgjb" placeholder="请输入成果级别" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果报告及附件" prop="cgbgjfj">-->
    <!--          <el-input v-model="form.cgbgjfj" placeholder="请输入成果报告及附件" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果说明" prop="cgsm">-->
    <!--          <el-input v-model="form.cgsm" placeholder="请输入成果说明" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果奖项" prop="cgjx">-->
    <!--          <el-input v-model="form.cgjx" placeholder="请输入成果奖项" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果奖励" prop="cgjl">-->
    <!--          <el-input v-model="form.cgjl" placeholder="请输入成果奖励" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="成果附件" prop="cgfj">-->
    <!--          <el-input v-model="form.cgfj" placeholder="请输入成果附件" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="转化说明" prop="zhsm">-->
    <!--          <el-input v-model="form.zhsm" placeholder="请输入转化说明" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="转化报告及附件" prop="zhAttachment">-->
    <!--          <el-input v-model="form.zhAttachment" placeholder="请输入转化报告及附件" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="转化时间" prop="zhsj">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.zhsj"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择转化时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目决算" prop="xmjs">-->
    <!--          <el-input v-model="form.xmjs" placeholder="请输入项目决算" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="决算报告及附件" prop="jsAttachment">-->
    <!--          <el-input v-model="form.jsAttachment" placeholder="请输入决算报告及附件" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目成本" prop="xmcb">-->
    <!--          <el-input v-model="form.xmcb" placeholder="请输入项目成本" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="科研机构代码" prop="kyCode">-->
    <!--          <el-input v-model="form.kyCode" placeholder="请输入科研机构代码" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="决算时间" prop="jsTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.jsTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择决算时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目评价" prop="xmpj">-->
    <!--          <el-input v-model="form.xmpj" placeholder="请输入项目评价" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="评价报告及附件" prop="pjAttachment">-->
    <!--          <el-input v-model="form.pjAttachment" placeholder="请输入评价报告及附件" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="项目评分" prop="xmpf">-->
    <!--          <el-input v-model="form.xmpf" placeholder="请输入项目评分" />-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="评价时间" prop="evaluateTime">-->
    <!--          <el-date-picker clearable-->
    <!--            v-model="form.evaluateTime"-->
    <!--            type="datetime"-->
    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
    <!--            placeholder="请选择评价时间">-->
    <!--          </el-date-picker>-->
    <!--        </el-form-item>-->
    <!--        <el-form-item label="创建人" prop="createUser">-->
    <!--          <el-input v-model="form.createUser" placeholder="请输入创建人" />-->
    <!--        </el-form-item>-->
    <!--      </el-form>-->
    <!--      <div slot="footer" class="dialog-footer">-->
    <!--        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>-->
    <!--        <el-button @click="cancel">取 消</el-button>-->
    <!--      </div>-->
    <!--    </el-dialog>-->

    <!-- 添加或修改项目管理对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <el-col :span="8">
            <el-form-item label="统计口径" prop="projectScope">
              <el-input v-model="form.projectScope" placeholder="请输入统计口径" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公司代码" prop="schoolCode">
              <el-input v-model="form.schoolCode" placeholder="请输入公司代码" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公司名称" prop="schoolName">
              <el-input v-model="form.schoolName" placeholder="请输入公司名称" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="公司代码" prop="collegeCode">
              <el-input v-model="form.collegeCode" placeholder="请输入公司代码" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公司名称" prop="collegeName">
              <el-input v-model="form.collegeName" placeholder="请输入公司名称" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="部系代码" prop="deptCode">
              <el-input v-model="form.deptCode" placeholder="请输入部系代码" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="部系名称" prop="deptName">
              <el-input v-model="form.deptName" placeholder="请输入部系名称" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="科研机构名称" prop="kyjgName">
              <el-input v-model="form.kyjgName" placeholder="请输入科研机构名称" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="项目编号" prop="projectNum">
              <el-input v-model="form.projectNum" placeholder="请输入项目编号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="项目名称" prop="projectName">
              <el-input v-model="form.projectName" placeholder="请输入项目名称" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="项目类别" prop="projectCate">
              <el-input v-model="form.projectCate" placeholder="请输入项目类别" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="项目负责人" prop="projectUser">
              <el-input v-model="form.projectUser" placeholder="请输入项目负责人" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="项目专家" prop="xmzj">
              <el-input v-model="form.xmzj" placeholder="请输入项目专家" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="学科" prop="xk">
              <el-input v-model="form.xk" placeholder="请输入学科" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="项目预算" prop="xmys">
              <el-input v-model="form.xmys" placeholder="请输入项目预算" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="申报类型" prop="sblx">
              <el-input v-model="form.sblx" placeholder="请输入申报类型" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="开始时间" prop="startTime">
              <el-date-picker clearable
                              v-model="form.startTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择开始时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="结束时间" prop="endTime">
              <el-date-picker clearable
                              v-model="form.endTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择结束时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="项目说明" prop="instructions">
              <el-input v-model="form.instructions" placeholder="请输入项目说明" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="申请人" prop="applyUser">
              <el-input v-model="form.applyUser" placeholder="请输入申请人" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="申请部门" prop="applyDept">
              <el-input v-model="form.applyDept" placeholder="请输入申请部门" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="申请时间" prop="applyTime">
              <el-date-picker clearable
                              v-model="form.applyTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择申请时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="审核" prop="audit">
              <el-input v-model="form.audit" placeholder="请输入审核" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="意见" prop="opinion">
              <el-input v-model="form.opinion" placeholder="请输入意见" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="审核时间" prop="auditTime">
              <el-date-picker clearable
                              v-model="form.auditTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择审核时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="驳回时间" prop="rejectTime">
              <el-date-picker clearable
                              v-model="form.rejectTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择驳回时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="立项编号" prop="lxNum">
              <el-input v-model="form.lxNum" placeholder="请输入立项编号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="立项时间" prop="lxTime">
              <el-date-picker clearable
                              v-model="form.lxTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择立项时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="批文号" prop="pwh">
              <el-input v-model="form.pwh" placeholder="请输入批文号" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="活动编码" prop="hdbm">
              <el-input v-model="form.hdbm" placeholder="请输入活动编码" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="活动名称" prop="hdmc">
              <el-input v-model="form.hdmc" placeholder="请输入活动名称" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="活动情况" prop="hdqk">
              <el-input v-model="form.hdqk" placeholder="请输入活动情况" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="活动报告附件" prop="hdbgfj">
              <el-input v-model="form.hdbgfj" placeholder="请输入活动报告附件" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="活动时间" prop="hdsj">
              <el-date-picker clearable
                              v-model="form.hdsj"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择活动时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="中检情况" prop="inspection">
              <el-input v-model="form.inspection" placeholder="请输入中检情况" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="中检报告附件" prop="zjbgfj">
              <el-input v-model="form.zjbgfj" placeholder="请输入中检报告附件" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="中检经费" prop="inspectionMoney">
              <el-input v-model="form.inspectionMoney" placeholder="请输入中检经费" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="中检时间" prop="inspectionTime">
              <el-date-picker clearable
                              v-model="form.inspectionTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择中检时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="项目状态" prop="projectState">
              <el-input v-model="form.projectState" placeholder="请输入项目状态" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="终结情况" prop="zjqk">
              <el-input v-model="form.zjqk" placeholder="请输入终结情况" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="完成时间" prop="finishTime">
              <el-date-picker clearable
                              v-model="form.finishTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择完成时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="成果名称" prop="cgmc">
              <el-input v-model="form.cgmc" placeholder="请输入成果名称" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="成果转化作者" prop="cgzhzz">
              <el-input v-model="form.cgzhzz" placeholder="请输入成果转化作者" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="成果分类" prop="cgfl">
              <el-input v-model="form.cgfl" placeholder="请输入成果分类" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="成果级别" prop="cgjb">
              <el-input v-model="form.cgjb" placeholder="请输入成果级别" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="成果报告及附件" prop="cgbgjfj">
              <el-input v-model="form.cgbgjfj" placeholder="请输入成果报告及附件" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="成果说明" prop="cgsm">
              <el-input v-model="form.cgsm" placeholder="请输入成果说明" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="成果奖项" prop="cgjx">
              <el-input v-model="form.cgjx" placeholder="请输入成果奖项" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="成果奖励" prop="cgjl">
              <el-input v-model="form.cgjl" placeholder="请输入成果奖励" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="成果附件" prop="cgfj">
              <el-input v-model="form.cgfj" placeholder="请输入成果附件" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="转化说明" prop="zhsm">
              <el-input v-model="form.zhsm" placeholder="请输入转化说明" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="转化报告及附件" prop="zhAttachment">
              <el-input v-model="form.zhAttachment" placeholder="请输入转化报告及附件" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="转化时间" prop="zhsj">
              <el-date-picker clearable
                              v-model="form.zhsj"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择转化时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="项目决算" prop="xmjs">
              <el-input v-model="form.xmjs" placeholder="请输入项目决算" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="决算报告及附件" prop="jsAttachment">
              <el-input v-model="form.jsAttachment" placeholder="请输入决算报告及附件" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="项目成本" prop="xmcb">
              <el-input v-model="form.xmcb" placeholder="请输入项目成本" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="科研机构代码" prop="kyCode">
              <el-input v-model="form.kyCode" placeholder="请输入科研机构代码" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="决算时间" prop="jsTime">
              <el-date-picker clearable
                              v-model="form.jsTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择决算时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="项目评价" prop="xmpj">
              <el-input v-model="form.xmpj" placeholder="请输入项目评价" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="评价报告及附件" prop="pjAttachment">
              <el-input v-model="form.pjAttachment" placeholder="请输入评价报告及附件" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="项目评分" prop="xmpf">
              <el-input v-model="form.xmpf" placeholder="请输入项目评分" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="评价时间" prop="evaluateTime">
              <el-date-picker clearable
                              v-model="form.evaluateTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择评价时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="创建人" prop="createUser">
              <el-input v-model="form.createUser" placeholder="请输入创建人" />
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  import { listProjectManage, getProjectManage, delProjectManage, addProjectManage, updateProjectManage } from "@/api/pm/projectManage";
  export default {
    name: "XjProjectManage",
    data() {
      return {
        // 按钮loading
        buttonLoading: false,
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 项目管理表格数据
        projectManageList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          projectScope: 'xj',
          schoolCode: undefined,
          schoolName: undefined,
          collegeCode: undefined,
          collegeName: undefined,
          deptCode: undefined,
          deptName: undefined,
          projectType: undefined,
          kyjgName: undefined,
          projectNum: undefined,
          projectName: undefined,
          projectCate: undefined,
          projectUser: undefined,
          xmzj: undefined,
          xk: undefined,
          xmys: undefined,
          sblx: undefined,
          startTime: undefined,
          endTime: undefined,
          instructions: undefined,
          applyUser: undefined,
          applyDept: undefined,
          applyTime: undefined,
          audit: undefined,
          opinion: undefined,
          auditTime: undefined,
          rejectTime: undefined,
          lxNum: undefined,
          lxTime: undefined,
          pwh: undefined,
          hdbm: undefined,
          hdmc: undefined,
          hdqk: undefined,
          hdbgfj: undefined,
          hdsj: undefined,
          inspection: undefined,
          zjbgfj: undefined,
          inspectionMoney: undefined,
          inspectionTime: undefined,
          projectState: undefined,
          zjqk: undefined,
          finishTime: undefined,
          cgmc: undefined,
          cgzhzz: undefined,
          cgfl: undefined,
          cgjb: undefined,
          cgbgjfj: undefined,
          cgsm: undefined,
          cgjx: undefined,
          cgjl: undefined,
          cgfj: undefined,
          zhsm: undefined,
          zhAttachment: undefined,
          zhsj: undefined,
          xmjs: undefined,
          jsAttachment: undefined,
          xmcb: undefined,
          kyType: undefined,
          kyCode: undefined,
          jsTime: undefined,
          xmpj: undefined,
          pjAttachment: undefined,
          xmpf: undefined,
          evaluateTime: undefined,
          createUser: undefined,
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {
          projectNum: [
            { required: true, message: "项目编号不能为空", trigger: "blur" }
          ],
          projectName: [
            { required: true, message: "项目名称不能为空", trigger: "blur" }
          ],
        }
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询项目管理列表 */
      getList() {
        this.loading = true;
        listProjectManage(this.queryParams).then(response => {
          this.projectManageList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          id: undefined,
          projectScope: undefined,
          schoolCode: undefined,
          schoolName: undefined,
          collegeCode: undefined,
          collegeName: undefined,
          deptCode: undefined,
          deptName: undefined,
          projectType: undefined,
          kyjgName: undefined,
          projectNum: undefined,
          projectName: undefined,
          projectCate: undefined,
          projectUser: undefined,
          xmzj: undefined,
          xk: undefined,
          xmys: undefined,
          sblx: undefined,
          startTime: undefined,
          endTime: undefined,
          instructions: undefined,
          applyUser: undefined,
          applyDept: undefined,
          applyTime: undefined,
          audit: undefined,
          opinion: undefined,
          auditTime: undefined,
          rejectTime: undefined,
          lxNum: undefined,
          lxTime: undefined,
          pwh: undefined,
          hdbm: undefined,
          hdmc: undefined,
          hdqk: undefined,
          hdbgfj: undefined,
          hdsj: undefined,
          inspection: undefined,
          zjbgfj: undefined,
          inspectionMoney: undefined,
          inspectionTime: undefined,
          projectState: undefined,
          zjqk: undefined,
          finishTime: undefined,
          cgmc: undefined,
          cgzhzz: undefined,
          cgfl: undefined,
          cgjb: undefined,
          cgbgjfj: undefined,
          cgsm: undefined,
          cgjx: undefined,
          cgjl: undefined,
          cgfj: undefined,
          zhsm: undefined,
          zhAttachment: undefined,
          zhsj: undefined,
          xmjs: undefined,
          jsAttachment: undefined,
          xmcb: undefined,
          kyType: undefined,
          kyCode: undefined,
          jsTime: undefined,
          xmpj: undefined,
          pjAttachment: undefined,
          xmpf: undefined,
          evaluateTime: undefined,
          createUser: undefined,
          createTime: undefined
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length!==1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加项目管理";
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.loading = true;
        this.reset();
        const id = row.id || this.ids
        getProjectManage(id).then(response => {
          this.loading = false;
          this.form = response.data;
          this.open = true;
          this.title = "修改项目管理";
        });
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            this.buttonLoading = true;
            if (this.form.id != null) {
              updateProjectManage(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              }).finally(() => {
                this.buttonLoading = false;
              });
            } else {
              addProjectManage(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              }).finally(() => {
                this.buttonLoading = false;
              });
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids;
        this.$modal.confirm('是否确认删除项目管理编号为"' + ids + '"的数据项？').then(() => {
          this.loading = true;
          return delProjectManage(ids);
        }).then(() => {
          this.loading = false;
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {
        }).finally(() => {
          this.loading = false;
        });
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('business/projectManage/export', {
          ...this.queryParams
        }, `projectManage_${new Date().getTime()}.xlsx`)
      }
    }
  };
</script>
